package com.usian.mapper;

import com.usian.articles.Articles;
import com.usian.certified.Certified;
import com.usian.money.Money;
import com.usian.order.Order;
import com.usian.transaction.Transaction;
import com.usian.user.User;
import org.apache.ibatis.annotations.*;


import java.util.List;

@Mapper
public interface UserMapper {
    public User selectUserOne(User user);

    void insert(User user1);

    User login(User user);

    User selectById(int id);

    int userInfoEdit(User user);

    List<Articles> selectUserArticles(@Param("id") Integer id);

    List<User> concernList(Integer id);
    @Insert(" insert into vermicelli(concern_id,vermicelli_id) values(#{id},#{userid})")
    Integer concern(Integer id, Integer userid);

    int deleteConcern(Integer id,Integer userid);

    List<Certified> certified( String idCard);

    void savecertified(Integer userid, String realName,String idCard);

    Certified selectCertifiedArticles(Integer id);
    @Select("select id from certified where id_card = #{idCard}")
    Integer updatecertifedById(String idCard);

    void updateById(Integer userid,Integer certifiedId);

    int deleteArticlesUser(Integer id);

    void addOrder(Order orders);


    void addAlipay(String subject, String tradeNo, String outTradeNo, String totalAmount, String buyerId, String gmtPayment, String buyerPayAmount);

    void concernById(Integer id);

    void essayById(Integer id);
    @Delete("delete from vermicelli where vermicelli_id = #{id} and concern_id = #{userid}")
    int close(Integer userid, Integer id);



    Integer update(Integer id);

    int addArticles(Articles articles);

    Integer selectUseressay(Integer id);

    Integer selectUserconcern(Integer id);

    Integer selectUserOnefens(Integer id);

    Integer selectUserfavorites(Integer id);
    @Select("select * from money where user_id = #{id}")
    Money money(Integer id);
    @Select("select * from transaction where user_id = #{id}")
    Transaction transaction(Integer id);
}
